/**
 * @see https://umijs.org/zh-CN/plugins/plugin-access
 * access 应该为一个数组,包含所配置路由的access名称
 * */
export default function access(initialState: { currentUser?: API.CurrentUser | undefined }) {
  const { currentUser } = initialState || {};

  return {
    Admin: currentUser && currentUser.access?.includes('admin'),
    Test: currentUser && currentUser.access?.includes('Test'),
  };
}
